#include <stdio.h>


int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        argv[1] = "E://CODE//C//CS50/smallwei.jpg"; // 替换为实际路径
    }

    FILE *file = fopen(argv[1], "r");

    if(file == NULL)
    {
        return 1;
    }

    unsigned char bytes[3];
    fread(bytes, 3,1,file);

    //jpg 前三位都是0xff 0xd8 0xff
    if (bytes[0] == 0xff && bytes[1] == 0xd8 && bytes[2] == 0xff)
    {
        printf("maybe jpg\n");
    }
    else
    {
        printf("no");
    }

    return 0; 
}